package top.rainf.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.rainf.domain.vo.AdminInfo;
import top.rainf.mapper.AdminInfoMapper;
import top.rainf.service.IAdminInfoService;

import java.util.List;

/**
 * @author 星环
 * @date Wed May 17 16:54:38 CST 2023
 * @description AdminInfo服务的实现类
 */
@Service
public class AdminInfoService implements IAdminInfoService {

    @Autowired
    AdminInfoMapper adminInfoMapper;

    @Override
    public List<AdminInfo> getAdminInfoList() {
        return adminInfoMapper.selectAll();
    }



    @Override
    public AdminInfo getOneById(int id) {
        return adminInfoMapper.selectById(id);
    }

    @Override
    public boolean deleteOneById(int id) {
        return adminInfoMapper.deleteById(id) == 1;
    }

    @Override
    public boolean deleteAll(List<Integer> idList) {
        return adminInfoMapper.deleteByIds(idList) == idList.size();
    }

    @Override
    public boolean updateById(AdminInfo adminInfo) {
        return adminInfoMapper.updateById(adminInfo) == 1;
    }
}
